
interface Article {
    title: string;
    content: string;
    author: string;
    date: Date;
    readCount: number;
}
// K为对象中的属性，先删除传入的属性，在挑选出传入的属性并将其设置为可以选状态
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>

// 将'author', 'date','readCount'设为可选参数
type CreateArticleOptions = Optional<Article, 'author' | 'date' | 'readCount'>

const obj4: CreateArticleOptions = {
    title: '',
    content: ''
}